/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UserInterface;

import Controller.SRCFacade;
import Exceptions.ConfigFileNotLoadedException;
import java.awt.event.ActionEvent;

/**
 *
 * @author subx
 */
class UnloadCommand extends Command {

    public UnloadCommand() {
        
    }

    @Override
    public void execute(ActionEvent evt) {
        SRCFacade facade = SRCFacade.getInstance();
        System.out.println("Chegou!");
        try {
            //Solicita à fachada que descarregue as configurações
            facade.disposeConfig();
        } catch (ConfigFileNotLoadedException ex) {
            AlertWindow alert = new AlertWindow();

            alert.showAlertWindow(SRCMain.getInstance(),
                                  "Falha ao descarregar configurações!",
                                  ex);
        }
    }

}
